package com.hook3.pianke.activity.base.radiouserbasepager.PrivateRadioViewpagerBase;

import android.app.Activity;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.hook3.pianke.Net.Url;
import com.hook3.pianke.R;
import com.hook3.pianke.domain.RadioPlayerViewPagerInfo;

import org.xutils.common.Callback;
import org.xutils.http.RequestParams;
import org.xutils.image.ImageOptions;
import org.xutils.x;

/**
 * Created by HOME on 2015/12/11.
 */
public class PrivateRadioViewpager2 extends PrivateRadioViewpagerBasePager {
    RadioPlayerViewPagerInfo radioPlayerViewPagerInfo;
    public PrivateRadioViewpager2(Activity activity, RadioPlayerViewPagerInfo radioPlayerViewPagerInfo){
        super(activity);
        this.radioPlayerViewPagerInfo = radioPlayerViewPagerInfo;
    }

    ImageView topBigPicture;
    TextView mRadioName;
    TextView mRadioComment;
    TextView mRadioLike;
    @Override
    public View initView() {
        View view = View.inflate(activity, R.layout.private_radio_viewpager2,null);
        topBigPicture = (ImageView) view.findViewById(R.id.iv_private_radio_viewpager2_bigicon);
        mRadioName = (TextView) view.findViewById(R.id.tv_private_radio_viewpager2_radio_name);
        mRadioComment = (TextView) view.findViewById(R.id.tv_private_radio_viewpager2_radio_comment);
        mRadioLike = (TextView) view.findViewById(R.id.tv_private_radio_viewpager2_radio_like);


        return view;
    }

    public void initData(){
        //请求大图
        RadioPlayerViewPagerInfo.DataEntity.PlayInfoEntity.ShareinfoEntity shareinfo =
                radioPlayerViewPagerInfo.getData().getPlayInfo().getShareinfo();
        String pic = radioPlayerViewPagerInfo.getData().getPlayInfo().getShareinfo().getPic();
        // params.addQueryStringParameter("wd", "xUtils");
        ImageOptions imageOptions = new ImageOptions.Builder().build();
        x.image().bind(topBigPicture, pic, imageOptions);

        mRadioName.setText(shareinfo.getTitle());
        mRadioComment.setText(String.valueOf(radioPlayerViewPagerInfo.getData().getComment()));
        mRadioLike.setText(String.valueOf(radioPlayerViewPagerInfo.getData().getLike()));

    }
}
